<template>
  <form @submit="handleSubmit">
    <slot></slot>
  </form>
</template>

<script>
export default {
  mounted () {
    this.$el.onsubmit = () => {
      return false
    }
    // 取submit按钮
    for (let i = 0; i < this.$el.length; i++) {
      if (typeof this.$el[i].attributes.type !== 'undefined' && (this.$el[i].attributes.type.value === 'text' || this.$el[i].attributes.type.value === 'password')) {
      }
    }
  },
  methods: {
    handleSubmit (e) {
      // this.$http[this.method](this.action, this.data)
      this.$emit('submit', e)
    }
  }
}
</script>
